package com.minjiang.blog.mapper;

import com.minjiang.blog.mode.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

/**
 * @Mapper 自动生成对应的实现类
 * @Repository 将数据访问层 (DAO 层 ) 的类标识为 Spring Bean，便于spring的识别
 */
@Mapper
@Component
public interface UserDao {
    @Select("select * from t_user where username=#{username} and password = #{password}")
    User findByUsernameAndPassword(@Param("username") String username,@Param("password") String password);
}
